﻿var 星星 = "#fUI/CN_Chat.img/roomList/Vip#";
var 奖励 = "#fUI/CashShop/CSDiscount/bonus#";
function start() {
    status = -1;

    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (mode == -1) {
        cm.dispose();
    } else {
        if (status >= 0 && mode == 0) {

            cm.sendOk("感谢你的光临！");
            cm.dispose();
            return;
        }
        if (mode == 1) {
            status++;
        } else {
            status--;
        }
        if (status == 0) {
			var tex2 = "";
            var text = "";
            for (i = 0; i < 10; i++) {
                text += "";
            }
            text += "#b会员VIP3需要以下道具物品#l:\r\n\r\n" 
			text += "#kVIP2称号#v1142176##z1142176# 数量 +1\r\n\r\n" 
			text += "#r"+奖励+"\r\n\r\n" 			
			text += "2.赞助点卷:数量 +500000\r\n" 
			text += "3.游戏金币:数量 +2亿\r\n"  
                        //text += "#v1032024#顶级透明时装,全属性+120  功魔+100\r\n"
						//text += "#v1003276#顶级透明时装,全属性+120  功魔+100\r\n"
						//text += "#v1072153#顶级透明时装,全属性+120  功魔+100\r\n"
						//text += "#v1082102#顶级透明时装,全属性+120  功魔+100\r\n"						
						//text += "#v1103029#六级翅膀1个\r\n"
						text += "4.#v4021009#10个#v4011007#10个#v2614000#30个#v2049116#50个#v2340000#50个\t\t\t\t\t\t\r\n\r\n"
						//text += "#r找GM领取一次提升满觉醒，满卷武器或装备\r\n\r\n"
						text += "5.#v1004492#  #v1052929#  #v1073057#  #v1082647#  #v1102828#\r\n\r\n"
						text += "6.#v1142178#  全属性+300  攻击力:+100\r\n\r\n"
						text += "6.#v1112901#  全属性+200  攻击力:+100\r\n\r\n"
						//text += "6.#v1004492#\r\n\r\n"
						//text += "#v1142803#万元户称号，全属性+500,功魔+200\r\n\r\n"						
						text += "#L1##r#e#v4031504#兑换礼包#l\r\n\r\n"
            cm.sendOk(text); 
        } else if (selection == 1) {
			if (cm.getInventory(4).isFull(0)){//判断第四个也就是其它栏的装备栏是否有一个空格
		    cm.sendOk("#b请保证其它栏位至少有2个空格,否则无法兑换.");
		    cm.dispose();
            } else if (!cm.haveItem(4031504,1)) {//判断物品
		    cm.sendOk("请你尽快收集道具物品,赞助中心在线充值哦!#v4031504#");
		    cm.dispose();
			} else if (!cm.haveItem(1112901,1)) {//判断物品
		    cm.sendOk("请你把闪环绕戒指放在背包里哦！#v1112901#");
		    cm.dispose();
			} else {
			cm.gainItem(1142176, -1);//扣除物品
			cm.gainItem(1112901, -1);//扣除物品
			cm.gainItem(4031504, -1);//扣除物品
			cm.gainItem(4021009, +10);//星石
			cm.gainItem(4011007, +10);//月石
			cm.gainItem(2614000, +30);//破功石
			cm.gainItem(2049116, +30);//强化混沌卷轴
			cm.gainItem(2340000, +30);//祝福
			cm.gainItem(1004492, +1);//冒险岛寻宝帽子
			cm.gainItem(1052929, +1);//冒险岛寻宝套装
			cm.gainItem(1073057, +1);//冒险岛寻宝鞋子
			cm.gainItem(1082647, +1);//冒险岛寻宝手套
			cm.gainItem(1102828, +1);//冒险岛寻宝披风
			//cm.gainItem(4001126, +100000);//扣物品	
			cm.gainNX(+500000);//扣点卷10000点
			cm.gainMeso(+20000000);//扣金币1
			//cm.给属性装备(1032024, 1, 0, 120, 120, 120, 120, 0, 0, 100, 100,150, 150, 5, 5, 8, 8, 0);//耳环
			//cm.给属性装备(1003276, 1, 0, 120, 120, 120, 120, 0, 0, 100, 100,150, 150, 5, 5, 8, 8, 0);//帽子
			//cm.给属性装备(1072153, 1, 0, 120, 120, 120, 120, 0, 0, 100, 100,150, 150, 5, 5, 8, 8, 0);//鞋子
			//cm.给属性装备(1082102, 1, 0, 120, 120, 120, 120, 0, 0, 100, 100,150, 150, 5, 5, 8, 8, 0);//手套
			//cm.给属性装备(1103029, 0, 0, 15, 15, 15, 15, 0, 0, 18, 18,0, 0, 0, 0, 0, 0, 0);//翅膀
			cm.给属性装备(1142178, 1, 0, 300, 300, 300, 300, 500, 500, 100, 100,180, 180, 20, 20, 0, 0, 0);//徽章
			cm.给属性装备(1112901, 1, 0, 200, 200, 200, 200, 0, 0, 100, 100,0, 0, 0, 0, 0, 0, 0);//闪电环绕戒指
			cm.sendOk("#b恭喜你成功领取了累计充值5千元礼包！");
			cm.worldMessage(6,"[赞助公告]：玩家【"+cm.getName()+"】领取会员VIP3感谢你对本服的大力支持！");//公告
		    cm.dispose();
			}
        }
    }
}